<?php
/**
 * Created by PhpStorm.
 * User: xiatong
 * Date: 2018/9/29
 * Time: 下午8:33
 */

namespace app\store\controller;

use app\store\model\Recharge as RechargeModel;

class Speople extends Controller
{
    public function list(){
        $model =new RechargeModel();
        $list =$model->getList();
        return $this->fetch('index',compact('list'));
    }

    public function add(){
        $model = new RechargeModel();
        if (!$this->request->isAjax()) {
            return $this->fetch('add');
        }
        // 新增记录
        if ($model->add($this->postData('recharge'))) {
            return $this->renderSuccess('添加成功', url('recharge/recharge_list'));
        }
        $error = $model->getError() ?: '添加失败';
        return $this->renderError($error);
    }

    public function mongo(){

        $manager =new \MongoDB();

    }
}